import {createRouter,createWebHistory} from 'vue-router';
import Home from './components/Home.vue';
import User from './components/User.vue';
import Profile from './components/Profile.vue';
import UserList from './components/UserList.vue';
import UserAdd from './components/UserAdd.vue';
//路由配置
const routes = [
    {path:'/',component:Home},//路由条目 
    {
        path:'/user',
        component:User,
        children:[
            {path:'',component:UserList},
            {path:'add',component:UserAdd}
        ]
    },
    {path:'/profile',component:Profile}
]
const router = createRouter({
    history:createWebHistory(),//浏览器历史对象
    routes//路由配置
});
export default router;